import React from 'react';
import { Card,Descriptions} from 'antd';
import Yuan from '@/utils/Yuan';
import {  history } from 'umi';
const CourseInfo = props =>{
    const {classTableInfo} = props;
    /**
     * 跳转课程详情
     * @param {*} courseId 
     */
    const goCourseDetail = (courseId) =>{
      history.push(`/lesson/list/detail/${courseId}`);
    }
    /**
     * 跳转教练详情
     * @param {*} record 
     */
    const go2UserDetail = (record) =>{
      history.push(`/employee/list/detail/${record.coachId}`);
    }
    return <>
        <Card title="基本信息" style={{marginBottom:32}}>
            <Descriptions size="small">
              {/* <Descriptions.Item label="场馆">{classTableInfo.venueName}</Descriptions.Item> */}
              <Descriptions.Item label="场地">{classTableInfo.siteName}</Descriptions.Item>
              <Descriptions.Item label="日期">{classTableInfo.date}</Descriptions.Item>
              <Descriptions.Item label="时间">{classTableInfo.timePeriod}</Descriptions.Item>
              <Descriptions.Item label="教练"><a onClick={()=>go2UserDetail(classTableInfo)}>{classTableInfo.coachName}</a></Descriptions.Item>
              <Descriptions.Item label="课程时长">{classTableInfo.courseDuration}</Descriptions.Item>
              <Descriptions.Item label="课时费"><Yuan>{classTableInfo.sellPrice}</Yuan></Descriptions.Item>
              <Descriptions.Item label="最多上课人数">{classTableInfo.maximumAttendance||0}</Descriptions.Item>
              <Descriptions.Item label="已预约人数">{classTableInfo.bookingNum||0}</Descriptions.Item>
            </Descriptions>
        </Card>
        <Card title="课程信息">
            <Descriptions size="small">
              <Descriptions.Item label="课程"><a onClick={()=>goCourseDetail(classTableInfo.courseId)}>{classTableInfo.courseName}</a></Descriptions.Item>
              <Descriptions.Item label="备注">{classTableInfo.courseIntroduction}</Descriptions.Item>
            </Descriptions>
        </Card>
    </>
}
export default CourseInfo;